#include<stdio.h>
#define MaxN 100000
#include<time.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
using namespace std;
int mmap[MaxN];
int col[MaxN];
int l_r[MaxN*2+10];
int r_l[MaxN*2+10];

void random_mmap(int n){
    srand(int(time(NULL)));
    memset(col,0,sizeof(col));
    memset(l_r,0,sizeof(l_r));
    memset(r_l,0,sizeof(r_l));
    for(int i=1;i<=n;i++){
        int x=rand()%n+1;
        /*
        while(1){
            x=rand()%n+1;
            if((i==x)||(i+x==n+1)){
                continue;
            }else{
                break;
            }
        }*/
        mmap[i]=x;
        col[mmap[i]]++;
        l_r[x-i]++;
        r_l[x+i]++;
    }
    /*
    for(int i=1;i<=n;i++){
        cout<<mmap[i]<<endl;
    }*/
}

int count_ct(int x,int y){
    int res=0;
    res+=col[y]+1+l_r[y-x]+1+r_l[x+y]+1;
    return res;
}

bool check(int n,int cnt){
    /*if (cnt%10==0){
        cout<<"µÚ"<<cnt<<"ÂÖ"<<endl;
    }*/
    bool flag=false;
    for (int i=1;i<=n;i++){
        if (col[mmap[i]]>1||l_r[mmap[i]-i]>1||r_l[mmap[i]+i]>1){
            flag=true;
            int min_ct=n+2;
            int min_col=-1;
            for (int j=1;j<=n;j++){
                /*if (i==j||i+j==n+1){
                    continue;
                }*/
                int ct=0;
                if(j==mmap[i]){
                    ct=col[j]+l_r[j-i]+r_l[i+j];
                }else{
                    ct=count_ct(i,j);
                }
                if(ct<min_ct){
                    min_ct=ct;
                    min_col=j;
                }
            }
            if (min_col==mmap[i]){
                //cout<<1<<endl;
                continue;
            }else{
                col[mmap[i]]--;
                l_r[mmap[i]-i]--;
                r_l[mmap[i]+i]--;
                mmap[i]=min_col;
                col[mmap[i]]++;
                l_r[mmap[i]-i]++;
                r_l[mmap[i]+i]++;
            }
        }
    }
    return flag;
}


int main(){
    int n;
    scanf("%d",&n);
    random_mmap(n);
    int cnt=0;
    while (1){
        cnt+=1;
        if(cnt>=100000){
            random_mmap(n);
            cnt=1;
        }
        bool flag=check(n,cnt);
        if (flag){
            continue;
        }else{
            break;
        }
    }
    cout<<"------------------------------"<<endl;
    for (int i=1;i<=n;i++){
        cout<<mmap[i]<<endl;
    }
    return 0;
}

